/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 * */

// AmzServer - Tototoy's server model.
// Author: tonyjobmails@gmail.com (tonyhack).
//
// Define class Log.
//
// The class Log is a Realization of log,
// It provide five kinds of log level - debug, info, warn, error and fatal.
//

#ifndef __LOG__LITE__H
#define __LOG__LITE__H

namespace amz {

class LogLite {
  public:
    inline LogLite() {}
    explicit LogLite(const char *log_file_name);
    ~LogLite() {}

    void SetLogName(const char *log_file_name);

    // five kinds of log level
    void Debug(const char *contect, ...);
    void Info(const char *contect, ...);
    void Warn(const char *contect, ...);
    void Error(const char *contect, ...);
    void Fatal(const char *contect, ...);

  private:
    // The max length of log file name
    static const int kFileLength = 128;

    void Log(const char *level, const char *content);

    char log_file_name_[kFileLength];
};

}  // namespace amz

#endif	// __LOG__LITE__H

